package com.jky.stmall.factory;
//工厂类
public class ComputerFactory {
    //根据参数来创建不同的电脑
    public Computer getComputer(String type){
        if ("book".equals(type)){
            return new BookComputer();
        }else if ("desktop".equals(type)){
            return new DesktopComputer();
        }else if ("aio".equals(type)){
            return new AIOComputer();
        }else {
            return null;
        }
    }
}
